<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%help}}".
 *
 * @property int $id
 * @property string $title 标题
 * @property string $content 帮助内容
 * @property string $thumb 课程展示封面
 * @property int $admin_id 管理员ID
 * @property int $listorder 显示排序
 * @property int $status 状态
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class Help extends \common\base\ActiveRecord {

    use \common\traits\Constants;
    use \common\traits\TimestampBehavior;

    const STATUS_ACTIVE = 10;
    const STATUS_DEFAULT = 0;

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%help}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['title', 'content'], 'required'],
            [['content'], 'string'],
            [['admin_id', 'listorder', 'status', 'created_at', 'updated_at'], 'integer'],
            [['title'], 'string', 'max' => 100],
            [['thumb'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'title' => '标题',
            'content' => '帮助内容',
            'thumb' => '课程展示封面',
            'admin_id' => '管理员ID',
            'listorder' => '显示排序',
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }

}
